home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / RDBYTSC.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  691b  |  33 lines

  1. /*    rdbytsc.c 4.3        */
  2.  
  3. /*F****************************************************************************
  4.  
  5. FUNCTION NAME:    rdbytsc
  6.  
  7. ACTION:        Reads a character from Port C using simple strobed I/O.
  8.         Returns a character.
  9.  
  10. PARAMETERS:    (None)
  11.  
  12. RETURNS:    (int) byte read from port C.
  13.  
  14. ******************************************************************************/
  15.  
  16. #include <hc11/io.h>
  17. #include <hc11/pio.h>
  18. #include <hc11/directives.h>
  19.  
  20. SMALL
  21. unsigned rdbytsc()
  22.  
  23.     {
  24.  
  25.     HC11.PIOC &= (~HNDS);        /* clear the Handshake bit */
  26.  
  27.     while ((HC11.PIOC & STAF) ==  0)    /* wait for the data */
  28.         ;        /* null statement */
  29.  
  30.     return ((unsigned) HC11.PORTCL) ;
  31.  
  32.     }    /* end of rdbytsc    */
  33.